package com.yuan.controller;

import com.yuan.entity.UserEntity;
import com.yuan.service.LoginService;
import com.yuan.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;
    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody UserEntity user) {
        return loginService.login(user);
    }
    @GetMapping("/user/logout")
    public ResponseResult logout() {
        return loginService.logout();
    }

}
